<template>
  <div class="notice_container">
    <div class="page_header">
      <div class="page_title">企业消息公告</div>
      <el-button type="primary" link @click="apiUnifiedCollectionGetParentTreeNodeAll(item)">
        更多
        <el-icon><ArrowRight /></el-icon>
      </el-button>
    </div>
    <div class="body_top_table">
     
      <el-table :data="messageList" :show-header="false" style="width: 100%" height="200px" @row-dblclick="tableRowDblclick">
        <el-table-column show-overflow-tooltip>
          <template #default="scope">
            <div class="table_item_box">
              <span class="title_dot"></span>
              <!-- <span class="title_type">[公司公告]</span> -->
              <span class="title_text">{{ scope.row.content }}</span>
            </div>
          </template>
        </el-table-column>
        <el-table-column>
          <template #default="scope">
            <div class="publish-item">
              <span class="publish-name">
                {{ scope.row.operatorName[0] }}
              </span>
              {{ scope.row.operatorName }}
            </div>
          </template>
        </el-table-column>
        <el-table-column align="center">
          <template #default="scope">
            {{ scope.row.createTime }}
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>


<script setup lang='ts'>
import { listNotice } from '@/api/system/notice/index';
import { apiMessageGetMessageByUser } from "@/api/enterpriseDoc/enterpriseDoorApi"
const messageList = ref<any[]>([]);
const { proxy } = getCurrentInstance() as any;
const props = defineProps({
  rowData: {
    type: Object,
    default: () => {
      return {}
    }
  }
})
// 获取表哥数据
const getNoticeData = async () => {
  let parmas = {
    page: 0,
    size: 5,
    teamId: props.rowData.libraryId,
    fileType:'enterprise'
  }
  let res: any = await apiMessageGetMessageByUser(parmas);
  if (res.code == 200) {
    messageList.value = res.data.rows;
  }
};
// 双击表格行
const tableRowDblclick = (row: any) => {
  console.log(row);
};
const apiUnifiedCollectionGetParentTreeNodeAll = (row: any) => {
  proxy.$router.push({ path: '/notice/notice/messageCenter' });
};
onMounted(() => {
  getNoticeData();
});
</script>
<style scoped lang='scss'>
.page_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notice_container {
  .page_title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
  }
}
.body_top_table {
  // overflow-x:hidden;

  .el-table {
    background-color: rgba(0, 0, 0, 0) !important;
  }
  .el-table ::v-deep tr {
    background-color: rgba(0, 0, 0, 0) !important;
  }
  .table_item_box {
    font-size: 13px;
    .title_dot {
      display: inline-block;
      width: 5px;
      height: 5px;
      background-color: #67c23a;
      margin-right: 6px;
    }
    .title_type {
      color: #6698ff;
      margin-right: 15px;
      font-weight: bold;
    }
    .title_text {
      font-weight: bold;
    }
  }
  .publish-item {
    display: flex;
    .publish-name {
      display: block;
      width: 20px;
      height: 20px;
      line-height: 20px;
      text-align: center;
      border-radius: 50%;
      background-color: #6698ff;
      color: white;
      margin-right: 5px;
    }
  }
}
</style>